import extraConfigEvent from '@/common/extra-config-event.js';
import { EMIT_PARAMS_OBJ } from '@/utils/constant';
import { $demoi18n } from '@/utils/lang';

export default {
  isCustomProertyPannel: true,
  propertyPannelName: `config_${process.env.xvueNameSpace_}state_switching`,
  componentName: 'staffLocationNew',
  config: {
    property: {
      valueType: 'string', // 数值类型
      componentStyle: 'dark',
      backgroundColor: 'rgba(255,255,255,0)',
      noDataPromptType: 'defaultPrompt',
      noDataPrompt: '',
      isAdaptive: false,
      data: [
        {
          status: '',
          min: 0,
          max: 1,
          icon: '',
          iconSmall: '',
          uploadList: [],
          imgUrl: '',
          extra: '',
        },
      ],
    },
    data: {
      dataSourceType: 'staticData',
      dataSource: '',
      apiCode: '',
      redisKey: '',
      params: [],
      tableData: [
        {
          field: 'status',
          mapping: 'status',
          explain: '运行状态',
        },
      ],
      autoRefresh: {
        switchEnable: false,
        actTypes: ['pull', 'push'],
        actType: 'pull',
        interval: 300,
        frequencyType: '',
      },
    },
    linkage: {},
  },
  advancedLinkage: {},
  events: [
    {
      id: 'c65c0001-0001-4346-9b7a-1b7f04c8523r',
      key: 'state-click',
      label: '状态切换',
      type: 'out',
      extraTpye: 'fieldName',
      description: '',
      parameters: [
        {
          id: 'r9d7f710-1230-45b1-bb87-7bcb8bec99e4',
          key: 'state_click_key',
          label: $demoi18n('panelEvent.label.eventKey'),
          value: '',
        },
        {
          id: 'dd788002-bpc2-4a32-a602-469090969e2s',
          key: EMIT_PARAMS_OBJ,
          label: '发出参数对象',
          hide: true,
          value: '',
        },
      ],
    },
    ...extraConfigEvent,
  ],
};
